package com.cx.atguigu.controller;

import jakarta.annotation.Resource;
import org.springframework.ai.deepseek.DeepSeekChatModel;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * Description:
 *
 * @Author atguigu
 * @Create 2025/8/26 9:19
 * @Version 1.0
 */
@RestController
public class DeepseekController {

    @Resource
    private DeepSeekChatModel deepSeekChatModel;

    @GetMapping("/chat")
    public String chat(@RequestParam(name = "question",defaultValue = "你好,你是谁") String question){
        String result = deepSeekChatModel.call( question);
        System.out.println("通过springAI调用deepseek的返回结果为: "+result);
        return result;
    }
}
